package com.cn.delan.web.mvc.admin.action;

import java.io.File;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

import com.cn.delan.core.util.FileUtil;
import com.cn.delan.web.mvc.admin.AdminConst;
import com.cn.delan.web.mvc.core.action.AbstractAction;
/**
 * 删除文件
 * @author BingGo
 *
 */
public class DelFilesAction extends AbstractAction {

	@Override
	public ModelAndView handle(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String path = this.getParameter(AdminConst.REQUEST_PARA_PATH);
		int count = FileUtil.del(new File(path));
		request.setAttribute(AdminConst.REQUEST_ATTR_MESSAGE, this.getFormatMessage("{admin.sysman.sucdel}"+count+"{admin.sysman.filecount}"));
		return this.getView(INPUT);
	}

}
